define(['common/js/service/boss-common-service-0.1'],
    function () {
        serviceModule.factory("PmsCommonService", function ($window, $http, $q, CommonRestService) {
            return {
                /**
                 * 获取项目分页
                 *查询的结果尽量简单
                 *不包括已经删除的项目
                 *没有场次的项目不返回
                 */
                findProjectPage: function (requestParams) {
                    return CommonRestService.query("/common/pms/findProjectPage", requestParams);
                },
                /**
                 * 获取场次分页
                 *查询的结果尽量简单
                 *不包括已经删除的项目
                 *没有场次的项目不返回
                 */
                findEventPage: function (requestParams) {
                    return CommonRestService.query("/common/pms/findEventPage", requestParams);
                },
                /**
                 * 获取项目列表
                 *查询的结果尽量简单
                 *不包括已经删除的项目
                 *没有场次的项目不返回
                 */
                getProjectList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getProjectList", requestParams);
                },
                /**
                 * 获取项目列表
                 *查询的结果尽量简单
                 *不包括已经删除的项目
                 *没有场次的项目不返回
                 */
                getProjectDetailList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getProjectDetailList", requestParams);
                },
                /**
                 * 获取场次列表
                 * 查询的结果尽量简单
                 * 不包括已经删除的场次
                 * 只返回未结束的场次
                 */
                getEventList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getEventList", requestParams);
                },
                /**
                 * 获取演出类型
                 */
                getProjectTypes: function (requestParams) {
                    return CommonRestService.query("/common/pms/getProjectTypes", requestParams);
                },
                /**
                 * 修改场次的状态
                 * 调用的DCS的服务接口
                 */
                updateEventState: function (requestParams) {
                    return CommonRestService.query("/common/pms/updateEventState", requestParams);
                },
                /**
                 * 根据场次ID查询票档列表 k-v对
                 * @param requestParams{eventId:----}
                 * @returns 票档列表
                 */
                getPriceList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getPriceList", requestParams);
                },

                getPriceList4IntegralRatio: function (requestParams) {
                    return CommonRestService.query("/common/pms/getPriceList4IntegralRatio", requestParams);
                },

                //查询套票列表
                findPriceCouponList: function (param) {
                    return CommonRestService.query("/common/pms/findPriceCouponList", param);
                },

                //查询套票列表
                findPriceCouponList4IntegralRatio: function (param) {
                    return CommonRestService.query("/common/pms/findPriceCouponList4IntegralRatio", param);
                },

                //查询所有座位类型
                findAllSeatClass: function () {
                    return CommonRestService.query("/common/pms/findAllSeatClass");
                },
                /**
                 * 查询场次下的票档
                 * @param eventId
                 */
                getPriceInfoList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getPriceInfoListByEventId",requestParams);
                },
                /**
                 * 查询有效的主办方列表
                 */
                getProjectOwners: function (prams) {
                    return CommonRestService.query("/common/pms/getProjectOwners", prams);
                },
//                /**
//                 * 查询有效的主办方列表
//                 * 默认返回(无主办方)条目
//                 */
//                getProjectOwnersWithDefault: function () {
//                    return CommonRestService.query("/common/pms/getProjectOwners", {
//                        "isDefault": 1,
//                        "includeDelete": false
//                    });
//                },
                getUserlist: function (requestParams) {
                    return CommonRestService.query("/common/pms/getUserlist", requestParams);
                },
                /**
                 * 查询场馆列表
                 */
                getPlaces: function (requestParams) {
                    return CommonRestService.query("/common/pms/getPlaces", requestParams);
                },
                /**
                 * 查询场地列表
                 */
                getSiteList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getSiteList", requestParams);
                },
                /**
                 * 查询场地版本列表
                 */
                getSiteVersionList: function (requestParams) {
                    if (requestParams.siteId == undefined) {
                        requestParams.siteId = 0
                    }
                    return CommonRestService.query("/common/pms/getSiteVersionList", requestParams);
                },
                getFloorList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getFloorList", requestParams);
                },
                getBoundList: function (requestParams) {
                    return CommonRestService.query("/common/pms/getBoundList", requestParams);
                },
                /**
                 * 给我一个图片路径
                 * 我换你一个BASE64编码
                 *    得到BASE64编码后最好处理一下换行符问题 否则可能显示不出来
                 */
                getImageByPath: function (requestParams) {
                    return CommonRestService.query("/common/pms/getImageByPath", requestParams);
                },
                /**
                 * 查询场次下的所有楼层以及座位信息（位置信息、商品信息、运营信息）
                 * @param eventId 场次ID
                 * @param [channelId] 渠道ID，可选
                 * @returns {*}
                 */
                loadFloorAndSeats: function (eventId,channelId,orderId, advanceOrderId,cartType) {
                    return CommonRestService.query("/common/pms/loadFloorAndSeats", {eventId: eventId,channelId:channelId,orderId: orderId, advanceOrderId: advanceOrderId,cartType:cartType});
                },
    

               getSiteListByPlaceId: function (requestParams) {
                    return CommonRestService.query("/common/pms/getSiteListByPlaceId", requestParams);
                },
                /**
                 * 根据项目或者场次统计 票档以及优惠相关数量
                 */

                censusCount: function (requestParams) {
                    return CommonRestService.query("/common/pms/censusCount", requestParams);
                },

            	/**
            	 * 无座获取票档：【场次ID】【渠道ID】,重点渠道ID
            	 */
                getPriceList4NoSeat : function(requestParams){
                   return CommonRestService.query("/common/pms/priceList",requestParams);
                },
                
                /**
                 * 根据场次ID获取票面列表
                 */
                getTicketFaceByEventId : function(requestParams){
                	 return CommonRestService.query("/common/pms/getTicketFaceByEventId",requestParams);
                },
                /*
                * 获取项目属性(主办,合办,租场)
                * */
                getProjectAttrs: function (prams) {
                    return CommonRestService.query("/common/state/getProjectAttrs", prams);
                },
                /**
                 * 检验场次复制运营
                 */
                verifyEventOperation : function(requestParams){
                    return CommonRestService.query("/common/pms/verifyEventOperation",requestParams);
                },
                /**
                 * 场次复制运营
                */
                copyEventOperation : function(requestParams){
                    return CommonRestService.query("/common/pms/copyEventOperation",requestParams);
                },
                queryBoundPriceList : function(requestParams){
                    return CommonRestService.query("/common/pms/queryBoundPriceList",requestParams);
                }
                
            };
        });
    });